package com.markerhub.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.markerhub.entity.Banner;
import com.markerhub.mapper.BannerMapper;
import com.markerhub.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @author Li Sipeng
 * @version 4.1 on   2022-12-07 13:43
 */
@Service
public class BannerServiceImpl implements BannerService {
    @Autowired
    private BannerMapper bannermapper;

    @Override
    public ArrayList<Banner> findAllBanner() {
        return bannermapper.findAllBanner();
    }

    @Override
    public Boolean delBannerById(Integer bannerid) {
        bannermapper.deleteById(bannerid);
        return true;
    }

    @Override
    public Integer addBanner(Banner banner) {
        return bannermapper.insert(banner);
    }

    @Override
    public Integer editBanner(Banner banner) {
        return bannermapper.updateById(banner);
    }


}
